#include <bits/stdc++.h>
#include <stdio.h>

using namespace std;
int main()
{
	char str[1010] = {0};
	char c, temp;
	int n, i, j, map[101][101] = {0}, res[101][101] = {0}, flag = 1;
	cin >> c >> n;
	cin.getline(str, 1010);
	for(i = 0; i < n; i++)
	{
		cin.getline(str, 1010);
		for(j = 0; j < n; j++)
		{
			if(str[j] == '@')
			{
				map[i][j] = 1;
				res[n - i - 1][n - j - 1] = 1;
			}
		}
	}
	for(i = 0; i < n; i++)
		for(j = 0; j < n; j++)
			if(res[i][j] != map[i][j])
			{
				flag = 0;
				break;
			}	
	if(flag)
		cout << "bu yong dao le" << endl;
	for(i = 0; i < n; i++)
	{
		for(j = 0; j < n; j++)
			if(res[i][j] == 1)
				cout << c;
			else
				cout << " ";
		cout << endl;
	}
		
	return 0;
} 
